package edu.bbu.commonproject.desktop.gui.view.swing.utils;

import java.awt.BorderLayout;
import java.awt.Dimension;
import java.awt.Graphics;

import javax.swing.BorderFactory;
import javax.swing.JFrame;
import javax.swing.JPanel;
import javax.swing.JScrollPane;

public class HelpFrame extends JFrame
{
	private JPanel helpPanel;
	private JScrollPane scrollPane;
	
	public HelpFrame()
	{
		Design.setLookAndFeel();
		
		helpPanel = new JPanel()
		{
			protected void paintComponent(Graphics g)
			{
				g.drawImage(Design.HELP_MENU, 0, 0, null);
			}
		};
		helpPanel.setPreferredSize(new Dimension(Design.HELP_MENU.getWidth(null) - 25, Design.HELP_MENU.getHeight(null)));
		
		scrollPane = new JScrollPane(helpPanel);
		scrollPane.setPreferredSize(new Dimension(850, 640));	
		scrollPane.getVerticalScrollBar().setUnitIncrement(35);
		scrollPane.setBorder(BorderFactory.createEmptyBorder());
		
		this.setTitle("MongoDB file - share - Help");
		this.setResizable(false);
		this.setIconImage(Design.BASE_ICON);
		this.setDefaultCloseOperation(DISPOSE_ON_CLOSE);
		
		this.getContentPane().add(scrollPane, BorderLayout.CENTER);
		this.pack();
		this.setLocationRelativeTo(null);
		
		this.setVisible(true);
		
	}
}
